feat: add feedback feature for students and teachers#488
Conversation
|
@weiwei-gitch is attempting to deploy a commit to the 007's projects Team on Vercel. A member of the Team first needs to authorize it. |
Thanks for creating a PR for your Issue!
|
|
|
||
| @app.route("/admin/feedback") | ||
| def admin_feedback(): | ||
| if session.get("admin_logged_in") != True: |
There was a problem hiding this comment.
Admin feedback page always redirects due to nonexistent session key
admin_logged_in is never set anywhere in the codebase; every other admin route checks session.get("logged_in") and session.get("admin_id"), so legitimate admins are always bounced to the login page.
| if session.get("admin_logged_in") != True: | |
| if not session.get("logged_in") or not session.get("admin_id"): |
Prompt to fix with AI
Copy this prompt into your AI coding assistant to fix this issue.
In `app.py` at line 1658, the condition `if session.get("admin_logged_in") != True:` uses a session key that is never set anywhere in the application. Fix it to match the existing admin auth pattern used throughout the codebase: replace line 1658 with `if not session.get("logged_in") or not session.get("admin_id"):`. This makes the admin feedback page consistent with every other admin-only route (e.g. lines 286, 342) and allows authenticated admins to actually access the page.
Confidence Score: 2/5 - Changes NeededNot safe to merge — the admin feedback page in Key Findings:
Files requiring special attention
|
Which issue does this PR close?
Rationale for this change
The platform had no way for students or teachers to share thoughts, report issues, or suggest improvements from within the platform. This PR adds a dedicated Feedback feature to make the platform more community-driven and help maintainers identify pain points faster.
What changes are included in this PR?
feedbacktable to the database viainit_db()inapp.py/feedbackroute (GET/POST) for submitting feedback/admin/feedbackroute with correctsession["logged_in"]auth check for admins to view all submissionstemplates/feedback.html— feedback form with role selector (Student/Teacher), name, email, feedback type dropdown, message textarea, and star rating (1–5)templates/admin_feedback.html— standalone admin page (matching admin layout style) showing all feedback submissions in a tablebase.htmlAre these changes tested?
logged_inconsistent with the rest of the admin auth system.Are there any user-facing changes?